
const mongoClient = require("mongodb").MongoClient;

function myDB () {
    let db = null;
    this.instance = async () => {
        if (!db) {
            let connect = await mongoClient.connect("mongodb://localhost:27017");
            db = connect.db("kuaishou-hub");
        }
        return db;
    };
}

let obj = myDB;

module.exports = obj;